package com.liangwj.springbootdesignpatterns.structureTypePatterns.adapter.demo_2.impl;

import com.liangwj.springbootdesignpatterns.structureTypePatterns.adapter.demo_2.Player;

/**
 * <b>Description:</b> 翻译类适配器 <br/>
 * @author Lingwenjun
 * @date 2019/1/23-15:49
 * @version 1.0
 */
//对象适配器
public class TranslateAdapter implements Player {

    private LiangPlayer liangPlayer;

    public TranslateAdapter() {
        liangPlayer = new LiangPlayer();
    }

    @Override
    public void attack() {
        liangPlayer.进攻();
    }

    @Override
    public void defense() {
        liangPlayer.防守();
    }
}
//类适配器
/*
public class TranslateAdapter extends LiangPlayer implements Player {

    @Override
    public void attack() {
        this.进攻();
    }

    @Override
    public void defense() {
        this.防守();
    }
}*/
